package it.osg.openstory.services;

import it.osg.openstory.dao.UserDAO;
import it.osg.openstory.model.User;

public class DatabaseAuthenticationService implements AuthenticationService{
	private UserDAO userDAO;

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	@Override
	public User authenticate(String userName, String password) throws Exception {
		return userDAO.findUser(userName, password);
	}

	@Override
	public User insertNewUser(User user) {
		return userDAO.insertNewUser(user);
	}

	@Override
	public User findUserByName(User user) {
		return userDAO.findUserByName(user);
	}

	@Override
	public User findUserByMail(User user) {
		return userDAO.findUserByMail(user);
	}
	
	
	
	
	
	
}
